package com.dx.service.impl;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import java.util.UUID;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.dx.dao.ItemsDao;
import com.dx.pojo.Finding;
import com.dx.pojo.FindingDetail;
import com.dx.pojo.Findingdata;
import com.dx.pojo.ItemCondition;
import com.dx.pojo.ItemsCategory;
import com.dx.pojo.ItemsDetail;
import com.dx.pojo.LosingDeal;
import com.dx.pojo.LosingInfo;
import com.dx.pojo.Losingdata;
import com.dx.pojo.PickingDeal;
import com.dx.pojo.PickingInfo;
import com.dx.pojo.UserRelative;
import com.dx.pojo.losingItemInfo;
import com.dx.pojo.pickItemInfo;
import com.dx.service.ItemsService;

@Service("itemsService")
public class ItemsServiceImpl implements ItemsService {
    @Resource
    private ItemsDao itemsDao;
	
	@Override
	public List<ItemsCategory> showallcate() {
		// TODO Auto-generated method stub
		return this.itemsDao.itemsCate();
	}

	@Override
	public int insertItems(ItemsDetail itemsDetail) {
		// TODO Auto-generated method stub
		itemsDetail.setItemsId(UUID.randomUUID().toString().replaceAll("-", ""));
		return this.itemsDao.insertdetailinfo(itemsDetail);
	}

	@Override
	public String itemsCatename(int id) {
		// TODO Auto-generated method stub
		return this.itemsDao.itemsCatename(id);
	}

	
	//添加失物信息
	@Override
	public int insertPicking(PickingInfo pickingInfo) {
		// TODO Auto-generated method stub
		pickingInfo.setPickingID(UUID.randomUUID().toString().replaceAll("-", ""));
		return this.itemsDao.insertPickingInfo(pickingInfo);
	}
	
	
    //添加寻物信息
	@Override
	public int insertLosing(LosingInfo losingInfo) {
		// TODO Auto-generated method stub
		losingInfo.setLosingId(UUID.randomUUID().toString().replaceAll("-", ""));
		return this.itemsDao.insertlosinginfo(losingInfo);
	}

	@Override
	public List<LosingInfo> querylosinginfo(LosingInfo losinginfo) {
		// TODO Auto-generated method stub
		return this.itemsDao.selectlosinginfo(losinginfo);
	}
    
	//查询失物格式
	@Override
	public int countalllosing(LosingInfo losinginfo) {
		// TODO Auto-generated method stub
		return this.itemsDao.selectcountalllosing(losinginfo);
	}
   
	//查询寻物
	@Override
	public List<PickingInfo> querypickinginfo(PickingInfo pickingInfo) {
		// TODO Auto-generated method stub
		return this.itemsDao.selectpickinginfo(pickingInfo);
	}
 
	//查询寻物个数
	@Override
	public int countallpicking(PickingInfo pickingInfo) {
		// TODO Auto-generated method stub
		return this.itemsDao.selectcountallpicking(pickingInfo);
	}

	@Override
	public pickItemInfo selectdetailpicking(String id) {
		// TODO Auto-generated method stub
		return this.itemsDao.selectdetailpicking(id);
	}

	@Override
	public losingItemInfo selectdetaillosing(String id) {
		// TODO Auto-generated method stub
		return this.itemsDao.selectdetaillosing(id);
	}

	@Override
	public List<LosingInfo> selectuserlosing(LosingInfo losinginfo) {
		// TODO Auto-generated method stub
		return this.itemsDao.selectuserlosing(losinginfo);
	}

	@Override
	public int selectcountuserlosing(LosingInfo losinginfo) {
		// TODO Auto-generated method stub
		return this.itemsDao.selectcountuserlosing(losinginfo);
	}

	@Override
	public List<PickingInfo> selectuserpicking(PickingInfo pickinginfo) {
		// TODO Auto-generated method stub
		return this.itemsDao.selectuserpicking(pickinginfo);
	}

	@Override
	public int selectcountuserpicking(PickingInfo pickinginfo) {
		// TODO Auto-generated method stub
		return this.itemsDao.selectcountuserpicking(pickinginfo);
	}

	@Override
	public int selectcountallunlosing(LosingInfo losinginfo) {
		// TODO Auto-generated method stub
		return this.itemsDao.selectcountallunlosing(losinginfo);
	}

	@Override
	public List<LosingInfo> selectunlosinginfo(LosingInfo losinginfo) {
		// TODO Auto-generated method stub
		return this.itemsDao.selectunlosinginfo(losinginfo);
	}

	@Override
	public int selectcountallunpicking(PickingInfo pickinginfo) {
		// TODO Auto-generated method stub
		return this.itemsDao.selectcountallunpicking(pickinginfo);
	}

	@Override
	public List<PickingInfo> selectunpickinginfo(PickingInfo pickinginfo) {
		// TODO Auto-generated method stub
		return this.itemsDao.selectunpickinginfo(pickinginfo);
	}

	@Override
	public int updatelosingcheckdeal(LosingDeal losingDeal) {
		// TODO Auto-generated method stub
		return this.itemsDao.updatelosingcheckdeal(losingDeal);
	}

	@Override
	public int updatepickingcheckdeal(PickingDeal pickingDeal) {
		// TODO Auto-generated method stub
		return this.itemsDao.updatepickingcheckdeal(pickingDeal);
	}

	@Override
	public List<Losingdata> losingdatashow() {
		// TODO Auto-generated method stub
		return this.itemsDao.losingdatashow();
	}

	@Override
	public List<Losingdata> pickingdatashow() {
		// TODO Auto-generated method stub
		return this.itemsDao.pickingdatashow();
	}

	@Override
	public List<UserRelative> userrelative(String id) {
		// TODO Auto-generated method stub
		return this.itemsDao.userrelative(id);
	}

	@Override
	public List<PickingInfo> userrelpic(UserRelative userRelative) {
		// TODO Auto-generated method stub
		return this.itemsDao.userrelpic(userRelative);
	}

	@Override
	public int countuserrelpic(UserRelative userRelative) {
		// TODO Auto-generated method stub
		return this.itemsDao.countuserrelpic(userRelative);
	}

	@Override
	public int confirmitem(String id) {
		// TODO Auto-generated method stub
		return this.itemsDao.confirmitem(id);
	}

	@Override
	public List<PickingInfo> confirmbycondition(ItemCondition itemCondition) {
		// TODO Auto-generated method stub
		return this.itemsDao.confirmbycondition(itemCondition);
	}

	@Override
	public int countconfirmbycondition(ItemCondition itemCondition) {
		// TODO Auto-generated method stub
		return this.itemsDao.countconfirmbycondition(itemCondition);
	}

	@Override
	public int insertfinding(Finding finding) {
		// TODO Auto-generated method stub
		finding.setFindRecordsId(UUID.randomUUID().toString().replaceAll("-", ""));
		SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd");
		finding.setGetTime(sdf.format(new Date()));
		return this.itemsDao.insertfinding(finding);
	}

	@Override
	public List<FindingDetail> querybyfinding(FindingDetail findingDetail) {
		// TODO Auto-generated method stub
		return this.itemsDao.querybyfinding(findingDetail);
	}

	@Override
	public int countquerybyfinding(FindingDetail findingDetail) {
		// TODO Auto-generated method stub
		return this.itemsDao.countquerybyfinding(findingDetail);
	}

	@Override
	public List<Findingdata> queryallfinding() {
		// TODO Auto-generated method stub
		return this.itemsDao.queryallfinding();
	}

	@Override
	public int cancelloseitem(String id) {
		// TODO Auto-generated method stub
		return this.itemsDao.cancelloseitem(id);
	}

	@Override
	public int updatelos(ItemsDetail itemsDetail) {
		// TODO Auto-generated method stub
		return this.itemsDao.updatelos(itemsDetail);
	}

	@Override
	public int deletelose(String id) {
		// TODO Auto-generated method stub
		return this.itemsDao.deletelose(id);
	}

	@Override
	public int deletepic(String id) {
		// TODO Auto-generated method stub
		return this.itemsDao.deletepic(id);
	}

	@Override
	public int updatepic(ItemsDetail itemsDetail) {
		// TODO Auto-generated method stub
		return this.itemsDao.updatepic(itemsDetail);
	}
	
	

	
	

}
